import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)


const routes = [{
    path: '/home',
    name: 'Home',
    meta: {
      isTab: true, //判断是否是tab页
      title: '首页',
    },
    component: () => import('../views/Home.vue')
  },
  {
    path: '/classification',
    name: 'Classification',
    meta: {
      isTab: true,
      title: '分类',
    },
    component: () => import('../views/Classification.vue')
  },
  {
    path: '/shopping',
    name: 'Shopping',
    meta: {
      isTab: true,
      title: '购物车',
    },
    component: () => import('../views/Shopping.vue')
  },
  {
    path: '/my',
    name: 'My',
    meta: {
      isTab: true,
      title: '个人中心',
      index: 1
    },
    component: () => import( /* webpackChunkName: "about" */ '../views/My.vue')
  },
  {
    path: '/search',
    name: 'Search',
    meta: {
      isTab: false,
      title: '搜索',
    },
    component: () => import('../views/Search.vue')
  },
  {
    path: '/goodslist',
    name: ' GoodsList',
    meta: {
      isTab: false,
      title: '搜索',
    },
    component: () => import('../views/GoodsList.vue')
  },
  {
    path: '/goodsdetail',
    name: 'GoodsDetail',
    meta: {
      isTab: false,
      title: '商品详情'
    },
    component: () => import('../views/GoodsDetail.vue')
  },
  {
    path: '/login',
    name: 'Login',
    meta: {
      isTab: false,
      title: '登录'
    },
    component: () => import('../views/Login.vue')
  },
  {
    path: '/collection',
    name: 'Collection',
    meta: {
      isTab: false,
      title: '我的收藏'
    },
    component: () => import('../views/Collection.vue')
  },
  {
    path: '/history',
    name:'History',
    meta:{
      isTab:false,
      title:'历史记录'
    },
    component: () => import('../views/History.vue')
  },
  {
    path:'/addresslist',
    name:'AddressList',
    meta:{
      isTab:false,
      title:'联系人列表'
    },
    component: () => import('../views/AddressList.vue')
  },
  {
    path:'/order',
    name:'Order',
    meta:{
      isTab:false,
      title:'填写订单'
    },
    component: () => import('../views/Order.vue')
  },
  {
    path:'/orderlist',
    name:'OrderList',
    meta:{
      isTab:false,
      title:'订单列表'
    },
    component: () => import('../views/OrderList.vue')
  },
  {
    path:'/comment',
    name:'Comment',
    meta:{
      isTab:false,
      title:'立即评论'
    },
    component: () => import('../views/Comment.vue')
  },
  {
    path:'/userinfo',
    name:'UserInfo',
    meta:{
      isTab:false,
      title:'用户信息'
    },
    component: () => import('../views/UserInfo.vue')
  },
  {
    path:'/reviseinfo',
    name:'ReviseInfo',
    meta:{
      isTab:false,
      title:'修改账户信息'
    },
    component: () => import('../views/ReviseInfo.vue')
  },
  {
    path:'/resetinfo',
    name:'ResetInfo',
    meta:{
      isTab:false,
      title:'用户信息重置'
    },
    component: () => import('../views/ResetInfo.vue')
  },
  {
    path:'/brandlist',
    name:'BrandLsit',
    meta:{
      isTab:false,
      title:'品牌列表'
    },
    component: () => import('../views/BrandLsit.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router